"""
打开浏览器
"""

from selenium import webdriver
def chrome():
    driver = webdriver.Chrome()
    driver.implicitly_wait(30)
    driver.maximize_window()
    return driver

def get_table_text(table_element,row,cell):
    """
    给定行，列和表格对象，返回对应单元格里面的内容
    :param table_element: 表格对象
    :param row: 行
    :param cell: 列
    :return: 内容
    """
    row = int(row-1)
    cell = int(cell-1)
    tr_locator = ('tag name','tr')
    td_locator = ('tag name','td')
    tr = table_element.find_elements(*tr_locator)[row]
    td = tr.find_elements(*td_locator)[cell]
    return td.text.strip()
